package com.smartcruise.data;

import java.io.Serializable;

/**
 * Created by FengChaoQun
 * on 2018/1/21 0021
 */

public class MessageNotice implements Serializable {

    public enum MessageType {
        TASK(0),
        AUDIT(1),
        SIGN_IN(2),
        EVENT(3),
        EXCEPTION(4);

        int typeValue;

        MessageType(int typeValue) {
            this.typeValue = typeValue;
        }

        public static MessageType castIntToType(int typeValue) {
            switch (typeValue) {
                case 0:
                    return TASK;
                case 1:
                    return AUDIT;
                case 2:
                    return SIGN_IN;
                case 3:
                    return EVENT;
                case 4:
                    return EXCEPTION;
            }
            return null;
        }

    }

    private int type;

    public MessageNotice(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public MessageType getMessageType() {
        return MessageType.castIntToType(type);
    }
}
